import { request } from '@/utils/http'
/**
 * 题目管理
 */
export default {
  //删除题目
  delete: id => request.delete(`/question/${id}`),
  batchDelete: data => request.delete('/question/batch', { data }), // 批量删除
  //更新题目内容
  update: (id, data) => request.post(`/question/content?questionId=${id}`, data,),
  //查询所有题目
  list: (params = {}) => request.post(`/question/list`, null, { params },),
  //设置题目启用状态
  setStatusWithEnable: (id) => request.post(`/question/${id}/enable`),
  //设置题目禁用状态
  setStatusWithDisable: (id) => request.post(`/question/${id}/disable`),
  //导入题目
  importQuestionList: (data, config = {}) => request.post('/question/import', data, {
    headers: { 'Content-Type': 'multipart/form-data' },
    ...config
  }),
}
